<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>友链管理</title>
<link rel="stylesheet" type="text/css" href="css/easyui.css">
<link rel="stylesheet" type="text/css" href="css/icon.css">
<script type="text/javascript" src="js/jquery-1.7.1.js"></script>
<script type="text/javascript" src="js/jquery.easyui.min.js"></script>
<script type="text/javascript" language="javascript" src="js/commom.js"></script>
<script type="text/javascript" language="javascript" src="js/operate.js"></script>
<script type="text/javascript">
	$(document).ready(
			function() {
				dataGridInfo("message_data", "message/showMessages", "",
						"toolbar");
			});
	function editMessage() {
		var row = $('#message_data').datagrid('getSelected');
		if (row) {
			$('#dlg').dialog('open').dialog('setTitle', '查看留言');
			$("#title").get(0).value = row.title;
			$("#department").get(0).value = row.department;
			$("#address").get(0).value = row.address;
			$("#content").get(0).value = row.content;
		}
	}
</script>
</head>
<body>
	<div class="easyui-panel" data-options="fit:true" style='border: none'>
		<div class="easyui-layout" data-options="fit:true"
			style='border: none'>
			<div id='sss' data-options="region:'center'" style='border: none'>
				<table style='border: 1px solid red' id="message_data"
					class="easyui-datagrid">
					<thead>
						<tr>
							<th data-options="field:'id',width:30,align:'center'">编号</th>
							<th data-options="field:'name',width:80,align:'center'">姓名</th>
							<th data-options="field:'email',width:160,align:'center'">邮箱</th>
							<th data-options="field:'phone',width:120,align:'center'">电话</th>
							<th data-options="field:'code',width:80,align:'center'">邮编</th>
							<th data-options="field:'department',width:120,align:'center'">单位</th>
							<th data-options="field:'address',width:120,align:'center'">地址</th>
							<th data-options="field:'title',width:100,align:'center'">主题</th>
							<th data-options="field:'content',width:160,align:'center'">内容</th>
							<th data-options="field:'insertDate',width:160,align:'center'">留言时间</th>
						</tr>
					</thead>
				</table>
				<div id="toolbar">
					<a href="javascript:void(0)" class="easyui-linkbutton"
						iconCls="icon-edit" plain="true" onclick="editMessage()">查看</a>
					<a href="javascript:void(0)" class="easyui-linkbutton"
						iconCls="icon-remove" plain="true"
						onclick="destroyModel('message_data','删除留言','message/deleteMessage')">删除</a>
				</div>

				<div id="dlg" class="easyui-dialog"
					style="width: 500px; height: 400px; padding: 10px 20px"
					closed="true" buttons="#dlg-buttons">
					<div class="ftitle">留言信息</div>
					<form id="fm" method="post"  enctype="multipart/form-data">
						<div class="fitem">
							<label>主题:</label> <input id='title'
								name="message.title" type='text' disabled="disabled" style='width:270px;'
								>
						</div>
						<div class="fitem">
							<label>单位:</label> <input id='department'
								name="message.department" type='text' disabled="disabled" style='width:270px;'
								>
						</div>
						<div class="fitem">
							<label>地址:</label> <input id='address'
								name="message.address" type='text' disabled="disabled" style='width:270px;'
								>
						</div>
						<div class="fitem">
							<label>内容:</label> <textarea id='content'
								name="message.content"  disabled="disabled" style='width:270px;height:140px'
								></textarea>
						</div>
					</form>
				</div>
				<div id="dlg-buttons">
					 <a
						href="javascript:void(0)" class="easyui-linkbutton"
						iconCls="icon-cancel"
						onclick="javascript:$('#dlg').dialog('close')">取消</a>
				</div>
			</div>
		</div>
	</div>
</body>
</html>